﻿using FrameWork.Core.Chain.Entitys;

namespace FrameWork.Core.China
{
    public interface IChainEngine<P> where P : ProcessBase
    {
        /// <summary>
        /// 信号释放
        /// </summary>
        /// <param name="processBase"></param>
        void Set(P processBase);
        /// <summary>
        /// 执行任务
        /// </summary>
        /// <param name="processBase"></param>
        void Process(P processBase);
        /// <summary>
        /// 当前引擎立即执行执行
        /// </summary>
        /// <param name="processBase"></param>
        void Run(P processBase);
        /// <summary>
        /// 同步线程，排队任务
        /// </summary>
        /// <param name="processBase"></param>
        void RunWithQueue(P processBase);
        /// <summary>
        /// 同步线程，同一时只执行一个任务
        /// </summary>
        /// <param name="processBase"></param>
        void RunWithMonopoly(P processBase);
        /// <summary>
        /// 异步执行
        /// </summary>
        /// <param name="processBase"></param>
        void RunWithAsync(P processBase);
    }
}